package com.ews.onlineexchange.util;

import lombok.Data;

@Data
public class Result {
    private Boolean success;
    private String msg;
    private Object data;
    private String status;

    public static Result success(Object data){
        Result result = new Result();
        result.setStatus("200");
        result.setSuccess(true);
        result.setData(data);
        return result;
    }

    public static Result fail(String msg){
        Result result = new Result();
        result.setSuccess(false);
        result.setMsg(msg);
        return result;
    }

    public static Result fail(String msg,String status){
        Result result = new Result();
        result.setStatus(status);
        result.setSuccess(false);
        result.setMsg(msg);
        return result;
    }

}
